﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace peonwar
{
        [Serializable]
    class UnitHeavy1 : Unit
    {
        // ---CONSTRUCTORS---
        // Creation de l'unite en precisant l'instance du joueur "User"
        public UnitHeavy1(User player)
            : base()
        {
            // Caracteristique au type d'unité
            UnitType = 7;
            QueueOffset = 75;

            Initialize(player);
        }

        // ---PROPERTIES---
        // ---METHODES---
        // Animation idle qui joue en boucle
        public override void AnimationIdle()
        {
            base.AnimationIdle();
            Texture = GameTexture.TextureUnitHeavy1[0];
            Imgwidth = 70;
            Imgheight = 46;
            Indexmax = 1;

            Offset = 0;
        }

        // Animation walk qui est jouer en boucle une fois lancer
        public override void AnimationWalk()
        {
            base.AnimationWalk();
            Texture = GameTexture.TextureUnitHeavy1[1];
            Imgwidth = 70;
            Imgheight = 61;
            Indexmax = 7;

            Offset = 0;
        }

        // Animation degain de l'arme qui lance ensuite l'animation tirer
        public override void AnimationDrawIn()
        {
            base.AnimationDrawIn();
            Texture = GameTexture.TextureUnitHeavy1[2];
            Imgwidth = 70;
            Imgheight = 74;
            Indexmax = 4;

            Offset = 0;
        }

        // Animation tirer joue en boucle
        public override void AnimationFire()
        {
            base.AnimationFire();
            Texture = GameTexture.TextureUnitHeavy1[3];
            Imgwidth = 99;
            Imgheight = 59;
            Indexmax = 3;

            Offset = 15;
        }

        // Animation rengainer l'arme qui lance ensuite l'animation marcher
        public override void AnimationDrawOut()
        {
            base.AnimationDrawOut();
            Texture = GameTexture.TextureUnitHeavy1[4];
            Imgwidth = 70;
            Imgheight = 76;
            Indexmax = 4;

            Offset = 0;
        }

        // Animation mourrir, pas besoin de l'expliquer
        public override void AnimationDie()
        {
            base.AnimationDie();
            Texture = GameTexture.TextureUnitHeavy1[5];
            Imgwidth = 61;
            Imgheight = 43;
            Indexmax = 0;

            Offset = 0;
        }

        public override void Die(User player, User playerenemy, int hisIndex, int ticks)
        {
            if (CurrentAnim != "DIE")
                User.EffectList.Add(new AnimatedEffect(Position.X, Position.Y - 25, TeamBlue, GameTexture.TextureEffects[1], 62, 63, 3));
            base.Die(player, playerenemy, hisIndex, ticks);

        }
    }
}